<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="format-detection" content="telephone=no">
    <!--留存统计-->
    <script type="text/javascript" src="https://hy.yixueqm.com/zhiming/index.php/Home-Interface-remain?typeName=BBQM-Z&nickName=宝宝起名-支付页&channel=<!--{$Think.cookie.channel}-->&uid=<!--{$Think.cookie.uid}-->"></script>

    <title>宝宝起名</title>
    <!--[if lt IE 9]>  
        <script src="http://cdn.bootcss.com/html5shiv/r29/html5.js"></script>
        <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>    
    <![endif]-->
    <link rel="stylesheet" href="__PUBLIC__/css/ZM_share.css"/>
    <script src="__PUBLIC__/js/rem.js"></script>
    <script src="__PUBLIC__/js/jquery.min.js"></script>
    <style>
        body{background-color:#F6F0EA;}
        section{margin-bottom:0.4rem;background-color:#ffffff;}
        .top_ul{padding:0.2rem;list-style: none;}
        .Mcolor{color:#ed3439;}
        .top_ul li{
            padding:0.2rem;
            border-bottom: 1px dashed #898989;
            display: flex;
            justify-content:space-between;
            align-items: center;
        }

        .pay_wrap{border-bottom:0.4rem solid#f0f0f0;}
        .pay_title{font-size:0.36rem;text-align: center;color:#333333;padding-top:0.2rem;}
        .pay_ul{padding:0.2rem;list-style: none;}
        .pay_ul li{
            border-bottom: 1px solid #898989;
            display: flex;
            justify-content:space-between;
            align-items: center;
            -webkit-tap-highlight-color: transparent;
            padding:0.2rem 0;
        }
        .btn_box{padding:0 0.2rem 0.4rem;}
        .pay_right{
            width: 0.64rem;
            height:0.64rem;
            background: url('__PUBLIC__/images/bbqm_img/check.png') no-repeat;
            background-size:100% 100%;
            vertical-align: middle;
        }
        .active .pay_right{
            background: url('__PUBLIC__/images/bbqm_img/checked.png') no-repeat;
            background-size:100% 100%;
        }
        .wx_icon::before{
            content: '';
            width:0.64rem;
            height:0.64rem;
            background:url('__PUBLIC__/images/bbqm_img/bb_wxzf.png') no-repeat;
            background-size: 100% 100%;
            display:inline-block;
            vertical-align: middle;
            margin-right:0.1rem;
        }
        .zfb_icon::before{
            content: '';
            width:0.64rem;
            height:0.64rem;
            background:url('__PUBLIC__/images/bbqm_img/bb_zfbzf.png') no-repeat;
            background-size: 100% 100%;
            margin-right:0.1rem;
            display:inline-block;
            vertical-align: middle;
        }
        .confirmpay_btn{
            background-color:#DC4852;
            color:#ffffff;
            font-size:0.4rem;
            width: 100%;
            text-align: center;
            margin:0 auto;
            height:0.88rem;
            line-height: 0.88rem;
            border-radius: 0.2rem;
        }
        .check_icon{width:0.64rem;height:0.64rem;vertical-align: middle;}

        .zf_point{padding:0.3rem;}
        .zf_point p{font-size:0.28rem;color:#333333;margin-bottom:0.2rem;}
        .zf_point p:nth-last-child(1){margin-bottom:0;}
    </style>
</head>
<body>
    <include file="Public/header"/>
    <section>
        <ul class="top_ul">
            <li>
                <div class="top_left">测算项目</div>
                <div class="top_right">宝宝起名</div>
            </li>
            <li>
                <div class="top_left">订单价格</div>
                <div class="top_right Mcolor orderMoney">￥<!--{$Think.cookie.price}--></div>
            </li>
        </ul>
    </section>
    <section>
        <div class="pay_title">支付方式</div>
        <ul class="pay_ul">

            <if condition="$wxlogin eq 1">
                    <li class="check active"  data-id="wxzf">
                        <div class="pay_left wx_icon">微信支付</div><div class="pay_right"></div>
                    </li>
                <elseif condition="($channel eq qudao245) and ($Think.cookie.QTTopenid neq '')"/>
                    <li class="check" data-id="zfbzf245">
                        <div class="pay_left zfb_icon">支付</div><div class="pay_right"></div>
                    </li>
                <elseif condition="$channel eq appaidou "/>
                    <li class="check" data-id="appaidou">
                        <div class="pay_left zfb_icon">支付</div><div class="pay_right"></div>
                    </li>
                <else />
                    <li class="check active"  data-id="wxzf">
                        <div class="pay_left wx_icon">微信支付</div><div class="pay_right"></div>
                    </li>
                    <li class="check" data-id="zfbzf">
                        <div class="pay_left zfb_icon">支付宝支付</div><div class="pay_right"></div>
                    </li>
            </if>

        </ul>
        <div class="btn_box"><div class="confirmpay_btn">确认支付</div></div> 
    </section>
    <section>
        <div class="zf_point">
        <p>你的订单已经提交，请尽快完成支付，国学命理大师张云斐会和你一对一微信交流，为您开始分析宝宝的八字命理和策划美名。</p>
        <p>本交易由微信支付和支付宝提供安全保障，请放心支付</p>
        </div>
    </section>
    <!-- 抵用券 -->
    <include file="Public/coupon"/>
    <include file="Public/qudao135zhifu"/>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script src="__PUBLIC__/js/layer/layer.js"></script>
    <script>
        var zfType = 'wxzf';
        $('.check').click(function(){
            $(this).addClass('active').siblings().removeClass('active');
            zfType = $(this).attr('data-id');
        })
        document.querySelector('.confirmpay_btn').onclick = function(){
            if(zfType == 'zfbzf'){
                $.getJSON("<!--{:U('Index/getPayZfbUrl','',false)}-->",function(data){if(data.url){location.href=data.url;}else{window.location.href = "<!--{:U('Index/jumpPayZfb','',false)}-->";}});
            }else if(zfType == 'zfbzf245'){
                payMoney245();
            }else if(zfType =='appaidou'){
                aidouPay();exit;
            }
            else if(zfType == 'wxzf'){
                var wxlogin="<!--{$wxlogin}-->";
                var channel="<!--{$channel}-->";
                if(channel=='qudao135'){
                    payMoney135('wx');
                }else if (wxlogin == 1) {
                        WeixinJSBridge.invoke(
                                'getBrandWCPayRequest', {
                                    "appId":"<!--{$appId}-->",     //公众号名称，由商户传入
                                    "timeStamp":"<!--{$timeStamp}-->",         //时间戳，自1970年以来的秒数
                                    "nonceStr":"<!--{$nonceStr}-->", //随机串
                                    "package":"<!--{$package}-->",
                                    "signType":"<!--{$signType}-->",         //微信签名方式：
                                    "paySign":"<!--{$paySign}-->" //微信签名
                                },
                                function(res){
                                    if(res.err_msg == "get_brand_wcpay_request:ok" ) {
                                        location.href="<!--{:U('Bbqm/jieguoye','',false)}-->?ordernum=<!--{$Think.cookie.orderid}-->";
                                    }     // 使用以上方式判断前端返回,微信团队郑重提示：res.err_msg将在用户支付成功后返回    ok，但并不保证它绝对可靠。
                                }
                        );
                }else{
                    window.location.href="<!--{:U('Bbqm/paywx','',false)}-->";
                }

            }
        }
    </script>
</body>
</html>